/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 wave_sound.h

	$Header: /resource_editor/wave_sound.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( OPERATING_SYSTEM_FILE_H_INCLUDED )
#define OPERATING_SYSTEM_FILE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "abstract_file.h"
#include "windows.h"

// -------------------------------------------------------------
// os file class wrapps operating system specific file functions, emulates standard c
// file access functions (fopen, fclose, fseek, fwrite, fread)
// -------------------------------------------------------------

class t_os_file : public t_abstract_file
{
public:
	t_os_file();
	virtual ~t_os_file();

	virtual bool open( const char *filename, const char *mode );
	virtual bool close( );

	virtual t_int32		filesize( );
	virtual t_int32		seek( long offset, int origin );
	virtual t_uint32	read( void *buffer, t_uint32 size, t_uint32 count);
	virtual t_uint32	write( const void *buffer, t_uint32 size, t_uint32 count);
	virtual char *		get_file_handle();

private:
	HANDLE					m_file_handle;
};

typedef t_counted_ptr < t_os_file > t_os_file_ptr;

#endif // OPERATING_SYSTEM_FILE_H_INCLUDED